package com.ckv.qcm.model;

import java.util.ArrayList;

import com.ckv.qcm.model.dao.SectionDAO;

public class Section {

	private long id;
	private long idTest;
	private int nbQuestions;
	private String name;
	private ArrayList<Question> questions;
	private int orderNumber;
	private String subject;

	private static SectionDAO dao = new SectionDAO();

	public Section() {
		super();
	}

	public Section(long id, long idTest, int nbQuestions, String name,
			ArrayList<Question> questions, int orderNumber, String subject) {
		super();
		this.id = id;
		this.idTest = idTest;
		this.nbQuestions = nbQuestions;
		this.name = name;
		this.questions = questions;
		this.orderNumber = orderNumber;
		this.subject = subject;
	}

	public Section create() {
		return dao.create(this);
	}

	public Section update() {
		return dao.update(this);
	}

	public void delete() {
		dao.delete(this);
	}

	public static Section find(long id) {
		return dao.find(id);
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public int getorderNumber() {
		return orderNumber;
	}

	public void setorderNumber(int orderNumber) {
		this.orderNumber = orderNumber;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public long getIdTest() {
		return idTest;
	}

	public void setIdTest(long idTest) {
		this.idTest = idTest;
	}

	public int getNbQuestions() {
		return nbQuestions;
	}

	public void setNbQuestions(int nbQuestions) {
		this.nbQuestions = nbQuestions;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public ArrayList<Question> getQuestions() {
		return questions;
	}

	public void setQuestions(ArrayList<Question> questions) {
		this.questions = questions;
	}

}
